home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tcclib.zip / DEMO1.C < prev    next >
C/C++ Source or Header  |  1989-02-11  |  945b  |  44 lines

  1. /*****************************************************************
  2.                        ScanTree Demo
  3. ******************************************************************/
  4. #include "tcclib.h"
  5. #include <ctype.h>
  6. #include <conio.h>
  7. #include <string.h>
  8. #include <process.h>
  9.  
  10. int DisplayFile( FileStruc *fp, char *s )
  11. {
  12.      static int count = 0;
  13.  
  14.      SayF("%s%s\n", s, FileName( fp ) );
  15.      if ( count++ > 21 ) {
  16.          ScrollUp( 1, 1, 80, 25, 1 );
  17.          AtSay( 3, 25, "More?" );
  18.          HideCursor();
  19.          if ( toupper( GComm() ) == 'N' )
  20.              return( -1 );
  21.          count = 0;
  22.          gotoxy( 1, 23 );
  23.      }
  24.      return( 1 );
  25. }
  26.  
  27. void ScanTreeDemo()
  28. {
  29.     char Drive[5];
  30.     char Mask[15];
  31.  
  32.     clrscr();
  33.     Accept( 5, 5, "Drive : ", Drive, 1 );
  34.     Drive[0] = toupper(Drive[0]);
  35.     strcat( Drive, ":\\" );
  36.     Accept( 5, 7, "Mask  : ", Mask, 15 );
  37.     Say( "\n\n" );
  38.  
  39.     ScanTree( Drive, Mask, DisplayFile );
  40.  
  41.     Say( "\n\nPress any key ... " );
  42.     GComm();
  43. }
  44.